﻿using System.ComponentModel;
using System.Windows.Controls;
using System.Windows;

namespace GameLogic.Controls
{
    [TemplatePart(Name = C_GameNameTextBlockName, Type = typeof(TextBlock))]
    [TemplatePart(Name = C_DeveloperNameTextBlockName, Type = typeof(TextBlock))]
    [TemplatePart(Name = C_CompanyTextBlockName, Type = typeof(TextBlock))]
    public class AboutControl : Control
    {
        public AboutControl()
        {
            this.DefaultStyleKey = typeof(AboutControl);
        }

        public const string C_GameNameTextBlockName = "_gameName";
        public const string C_DeveloperNameTextBlockName = "_developerName";
        public const string C_CompanyTextBlockName = "_companyName";

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (DesignerProperties.IsInDesignTool)
            {
                return;
            }

            this.DataContext = GameContainer.Game;
        }
    }
}
